﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Entity = VietStar.Library.Entity;
using Business = VietStar.Library.Business;
using Commom = VietStar.Library.Commom.Algorithm;

public partial class controls_client_quenmatkhau : System.Web.UI.UserControl
{
    Entity.ThanhVien clsE_ThanhVien = new VietStar.Library.Entity.ThanhVien();
    Business.ThanhVien clsB_ThanhVien = new VietStar.Library.Business.ThanhVien();
    Commom.RandomString sinhchuoi = new VietStar.Library.Commom.Algorithm.RandomString();
    string chuoi = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        { }
    }
    private bool check(string save)
    {
        bool kiemtra = true;
        if (txtemail.Text == "")
        { Alert.Show("Bạn chưa nhập địa chỉ email !!!!"); kiemtra = false; }
        if (txtendangnhap.Text == "")
        { Alert.Show("Bạn chưa điền tên đăng nhập !!!!"); kiemtra = false; }
        return kiemtra;
    }
    //private void kiemtra()
    //{
    //    try
    //    {
    //        if (txtemail.Text != "" && txtendangnhap.Text != "")
    //        {
    //            clsE_ThanhVien.TenDangNhap = txtendangnhap.Text;
    //            clsE_ThanhVien.Email = txtemail.Text;
    //            DataTable dt = clsB_ThanhVien.Select_Pass_Email(clsE_ThanhVien);
    //            if (dt.Rows.Count > 0)
    //            {
    //                lbltext.Visible = true;
    //                lblpass.Text = sinhchuoi.GenerateRandomString(9, chuoi);
    //                clsE_ThanhVien.TenDangNhap = dt.Rows[0]["TenDangNhap"].ToString();
    //                clsE_ThanhVien.Email = dt.Rows[0]["Email"].ToString();
    //                clsE_ThanhVien.MatKhau = lblpass.Text;
    //                clsB_ThanhVien.Update_MatKhau(clsE_ThanhVien);
    //                Alert.Show("Lấy lại mật khẩu thành công !!!!");
    //            }
    //            else
    //            {
    //                lbltext.Visible = false;
    //                Alert.Show("Tên đăng nhập hoặc email không hợp lệ !!!!");
    //            }
    //        }
    //    }
    //    catch
    //    {}
    //}
    protected void btnquaylai_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/Default.aspx");
    }
    protected void btnok_Click(object sender, EventArgs e)
    {
        //kiemtra();
    }
}
